<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>

</head>
<body>
<div id="demo" class="one" title="鼠标经过"></div>
<script>
    var demo = document.getElementById("demo");
    alert(demo.getAttribute("title"));
    demo.setAttribute("class","two");
    demo.removeAttribute("title");

</script>
</body>
</html>